<?php

namespace Action\User\Preferences;

class ChangeEmail extends \Library\Action\UserAction 
	implements \Library\Action\AjaxAction {

	public function execute() {
		parent::execute();
		
		$email = trim($this->getParam( 'email' ));
		
		$user = _u();
		
		_c( 'Email', $email );
		
		$user->setEmail( $email );
		
		\Library\User\Session::getSession()->setUser( $user );
		
		return true;
	}
}
